﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ServerPlatform.Web;
using MapEntities;

namespace WebApp.Controls
{
    public partial class ShapeBehaviourEditor : BaseDataEditor<ShapeItemBehavior>
    {

        protected override void OnInit(EventArgs e)
        {
            LayerItemBehaviourEditor1.CreateInstance += new BaseDataEditor<LayerItemBehaviour>.OnCreateInstance(LayerItemBehaviourEditor1_CreateInstance);
            base.OnInit(e);
        }

        LayerItemBehaviour LayerItemBehaviourEditor1_CreateInstance()
        {
            return new ShapeItemBehavior();
        }

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected override void ShowEntity(ShapeItemBehavior entity)
        {
            LayerItemBehaviourEditor1.Edit(entity as ShapeItemBehavior);
        }

        public override ShapeItemBehavior GetEntity()
        {
            Current = LayerItemBehaviourEditor1.EndEdit() as ShapeItemBehavior;
            return Current;
        }
    }
}